package com.android.bookgarden.tabfragment;

import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.android.bookgarden.R;
import com.android.bookgarden.base.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * 课堂介绍
 * Create by zouqh
 * on 2018/12/4
 **/
public class KeTangFragment extends BaseFragment {
    @BindView(R.id.text)
    TextView text;
    String content;


    public static KeTangFragment newInstance(String text) {
        KeTangFragment fragment = new KeTangFragment();
        Bundle bundle = new Bundle();
        bundle.putSerializable("content", text);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            content = (String) getArguments().getSerializable("content");
        }

    }
    @Override
    protected int getLayoutId() {
        return R.layout.ketang_frament;
    }

    @Override
    protected void initView() {
        if (!TextUtils.isEmpty(content)){
            text.setText(Html.fromHtml(content));
        }

    }


}
